List all language names and articles on wikipedia.org¶
List all language names and articles on wikipedia.org.
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen('https://www.wikipedia.org/')
bs = BeautifulSoup(html, "html.parser")
nameList = bs.findAll('a', {'class' : 'link-box'})
for name in nameList:
print(name.get_text())
Output:
English
5 675 000+ articles
Deutsch
2 195 000+ Artikel
Русский
1 481 000+ статей
Italiano
1 446 000+ voci
. . .